#include <iostream>
#include <vector>

using namespace std;

vector < int> a(101);

int main()
{
    int n, dmax = 0, ddmin = 1001;
    cin >> n;
    for ( int i = 0; i < n; ++ i) {
        cin >> a[i];
    }

    for ( int i = 0; i < n - 1; ++ i) {
        dmax = dmax > ( a[i + 1] - a[i]) ? dmax : ( a[i + 1] - a[i]);
    }

    for ( int i = 0; i < n - 2; ++ i) {
        ddmin = ddmin < ( a[i + 2] - a[i]) ? ddmin : ( a[i + 2] - a[i]);
    }
//cout << dmax << ' ' << ddmin << endl;
    cout << ( ddmin > dmax ? ddmin : dmax) << endl;

    return 0;
}
